/**
 * Created by PC on 2017/8/30.
 */
// 删除

function delete_data() {
    var chk = $("input[name='data_id']:checked");
    if (chk.length < 1) {
        alert("请最少选择一项");
        return false
    }
    var delete_true = confirm("你确定要删除此数据");
    if (delete_true) {
        var delete_list = [];
        for (var i = 0; i < chk.length; i++) {
            console.log(chk[i]);
            delete_list.push(chk[i].value)
        }
        $.ajax({
            type: 'POST',
            url: delete_url,
            data: {"delete_list": JSON.stringify(delete_list)},
            success: function (data) {
                if (data.status == 1) {
                    alert(data.msg);
                    window.location.reload()
                }
                else {
                    alert(data.msg);
                    window.location.reload()
                }
            },
            error: function (request) {
                alert("服务器异常");
            }
        });
    }
    else {
        return false
    }
}